#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;

void shuffle(vector<int>& cards, int k)
{
    for(int i = 0; i < k; i++)
    {
        int right = cards.size() - 1;
        int left = (cards.size() - 1) / 2;

        vector<int> tmp;

        while(left >= 0 && right >= (cards.size() - 1) / 2 + 1)
        {
            tmp.push_back(cards[right]);
            tmp.push_back(cards[left]);
            right--;
            left--;
        }

        reverse(tmp.begin(), tmp.end());
        cards = tmp;
    }
    for(auto& e : cards)
        cout << e << " ";
}


int main() 
{
    int T;
    cin >> T;
    for(int i = 0; i < T; i++)
    {
        int n, k;
        cin >> n >> k;

        vector<int> cards;
        // for(int j = 0; j < 2 * n; j++)
        // {
        //     int x;
        //     cin >> x;
        //     cards.push_back(x);
        // }

        cards.resize(2 * n);
        for(int j = 0; j < 2 * n; j++) cin >> cards[j];

        shuffle(cards, k);
        cout << endl;
    }

    return 0;
}
